<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 1.^以什么作为开头
      //   var reg = /^a\d+/;
      //   var str = "a11222";
      //   console.log(reg.test(str));

      // 2.$以什么结尾
      //   var reg = /^a\d+\$$/;
      //   var str = "a111$";
      //   console.log(reg.test(str));

      //   var reg = /\bis\b/;
      //   var str = "this    a  knief";
      //   console.log(reg.test(str));
      var reg = /\bbox\b/;
      var className = "active  centerbox";
      console.log(reg.test(className));
    </script>
  </body>
</html>
